package com.ruoyi.system.stock.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.stock.mapper.StockBasicMapper;
import com.ruoyi.system.stock.domain.StockBasic;
import com.ruoyi.system.stock.service.IStockBasicService;

/**
 * 基础数据Service业务层处理
 * 
 * @author Galaxy
 * @date 2024-11-20
 */
@Service
public class StockBasicServiceImpl implements IStockBasicService 
{
    @Autowired
    private StockBasicMapper stockBasicMapper;

    /**
     * 查询基础数据
     * 
     * @param stockId 基础数据主键
     * @return 基础数据
     */
    @Override
    public StockBasic selectStockBasicByStockId(Long stockId)
    {
        return stockBasicMapper.selectStockBasicByStockId(stockId);
    }

    /**
     * 查询基础数据列表
     * 
     * @param stockBasic 基础数据
     * @return 基础数据
     */
    @Override
    public List<StockBasic> selectStockBasicList(StockBasic stockBasic)
    {
        return stockBasicMapper.selectStockBasicList(stockBasic);
    }

    /**
     * 新增基础数据
     * 
     * @param stockBasic 基础数据
     * @return 结果
     */
    @Override
    public int insertStockBasic(StockBasic stockBasic)
    {
        stockBasic.setCreateTime(DateUtils.getNowDate());
        return stockBasicMapper.insertStockBasic(stockBasic);
    }

    /**
     * 修改基础数据
     * 
     * @param stockBasic 基础数据
     * @return 结果
     */
    @Override
    public int updateStockBasic(StockBasic stockBasic)
    {
        stockBasic.setUpdateTime(DateUtils.getNowDate());
        return stockBasicMapper.updateStockBasic(stockBasic);
    }

    /**
     * 批量删除基础数据
     * 
     * @param stockIds 需要删除的基础数据主键
     * @return 结果
     */
    @Override
    public int deleteStockBasicByStockIds(Long[] stockIds)
    {
        return stockBasicMapper.deleteStockBasicByStockIds(stockIds);
    }

    /**
     * 删除基础数据信息
     * 
     * @param stockId 基础数据主键
     * @return 结果
     */
    @Override
    public int deleteStockBasicByStockId(Long stockId)
    {
        return stockBasicMapper.deleteStockBasicByStockId(stockId);
    }
}
